import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 26727
 * Date: 2025-07-17
 * Time: 20:47
 */
public class Test60 {
    static List<String> ret;
    static StringBuilder path;
    static int n1;
    static int left,right;
    public static List<String> generateParenthesis(int n) {
        ret = new ArrayList<>();
        path = new StringBuilder();
        n1 = n;
        dfs();
        return ret;
    }

    public static void dfs() {
        if(right == n1) {
            ret.add(path.toString());
        }
        if(left < n1) {
            path.append("(");
            left++;
            dfs();
            path.deleteCharAt(path.length()-1);
            left--;
        }
        if(right < left) {
            path.append(")");
            right++;
            dfs();
            path.deleteCharAt(path.length()-1);
            right--;
        }
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<String> ret = generateParenthesis(n);
        System.out.println(ret);
    }
}
